package com.weasel.security.interceptor;

import com.weasel.security.SecurityServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Dylan on 2016/1/22.
 */
public class AutoLoginInterceptor extends HandlerInterceptorAdapter {

    @Autowired
    private SecurityServer securityServer;

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        securityServer.autoLogin(request,response);
        return true;
    }

}
